package thursday;

public class Employee {
    private String name;
    private int age;
    private String gender;
    private String phone;

    public String getName(){
        return name;
    }
    //public void setName(){
       // this.name=name;
    //}错误
    // 把传入的name参数赋值给当前对象的name属性
    // Employee emp = new Employee();
    // 错误调用：不知道要设置什么名字
    // emp.setName();  // 编译错误：缺少参数
    // 正确调用：明确告诉方法要设置的名字
    /// emp.setName("张三");  // 把"张三"传给setName方法的name参数
    public void setName(String name){
        this.name=name;
    }
    public int getAge(){
        return age;
    }
    public void setAge(int age){
        this.age=age;
    }
    public String getGender(){
        return gender;
    }
    public void setGender(String gender){
        this.gender=gender;
    }
    public String getPhone(){
        return phone;
    }
    public void setPhone(String phone){
        this.phone=phone;
    }
    public String getINFO(){
        return "姓名" + name + ",年龄 " + age + ",性别 " + gender + ",电话 " + phone ;
    }
}
